package org.massdgames.thunder.client;

import java.util.ArrayList;

import org.massdgames.thunder.server.domain.Card;
import org.massdgames.thunder.server.domain.DeckSet;
import org.massdgames.thunder.server.domain.strategy.GinModule;

import com.google.inject.Guice;
import com.google.inject.Injector;

public class ThunderGate {

    private Injector injector;
    
    public ThunderGate(Injector injector) {
        this.injector = injector;
    }
    
    public void enter() throws Exception {

        DeckSet deckSet = injector.getProvider(DeckSet.class).get();
        deckSet.loadAll();
        System.out.println("Decksetty: " + deckSet);
        
        System.out.println("Hero Cards:");
        ArrayList<Card> heroCards = deckSet.getHeroCards();
        for (Card heroCard : heroCards) {
            System.out.println(" = " + heroCard);
        }

        System.out.println("Dungeon Cards:");
        ArrayList<Card> dungeonCards = deckSet.getDungeonCards();
        for (Card dungeonCard : dungeonCards) {
            System.out.println(" = " + dungeonCard);
        }

        ArrayList<Card> villageCards = deckSet.getVillageCards();
        System.out.println("Village Cards:");
        for (Card villageCard : villageCards) {
            System.out.println(" = " + villageCard);
        }
        System.out.println("Deckset: " + deckSet);
    }

    public static void main(String[] args) {
        try {
            Injector injector = Guice.createInjector(new GinModule());
            new ThunderGate(injector).enter();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
